package main.java.game.command;

import main.java.game.Card;
import main.java.game.Game;
import main.java.game.combatant.Hero;

public class RegenerateAllHeroes implements PlayerCommand {

	private Game game;
	public RegenerateAllHeroes (Game game){
		this.game = game;
	}
	@Override
	public void execute() {
		
		for(Card hero: game.getHeroPile()){
			Hero heroc = (Hero) hero;
			heroc.setLifepoints(heroc.getInitialLifePoints());
			
		}
		game.getPlayer().setGold(game.getPlayer().getGold()-50);
		System.out.println("All your heroes was regenerated " +
				"and it cost 50 gold coins, and now you have "
				+game.getPlayer().getGold()+ " gold coins!");
		

	}

}
